<!DOCTYPE html>
<html>
<head>
    <title>借阅管理</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/fontawesome.min.css">
    <link rel="stylesheet" href="/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/css/_all-skins.min.css">
    <link rel="stylesheet" href="/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="/css/main.css">

</head>
<body class="hold-transition skin-blue sidebar-mini">
<div id="app" class="wrapper" v-cloak>

    <main-header></main-header>
    <main-sidebar></main-sidebar>
    <!-- =============================================== -->
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <content-header title="借阅管理"></content-header>

        <!-- Main content -->
        <section class="content">
            <div v-show="showList">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">列表</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <div class="grid-btn">
                            <div class="form-group col-sm-2">
                                <input type="text" class="form-control" v-model="q.orderNumber" @keyup.enter="query"
                                       placeholder="借阅编号">
                            </div>
                            <a class="btn btn-default" @click="query">查询</a>
                            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                        </div>
                        <table id="table"></table>
                    </div>
                </div>
            </div>

            <div v-show="!showList">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="box">
                            <div class="box-header with-border">
                                <h3 class="box-title">借阅信息</h3>
                            </div><!-- /.box-header -->
                            <div class="box-body">
                                <form class="form-horizontal">
                                    <div class="form-group">
                                        <div class="col-sm-2 control-label">借阅编号</div>
                                        <div class="col-sm-7">
                                            <div class="checkbox">
                                                <label>
                                                    {{order.orderNumber}}
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-2 control-label">借阅时长</div>
                                        <div class="col-sm-7">
                                            <div class="checkbox">
                                                <label>
                                                    {{order.startDate}}~{{order.endDate}}
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-2 control-label">借阅状态</div>
                                        <div class="col-sm-7">
                                            <div class="checkbox">
                                                <label v-if="order.orderStatus == 0">
                                                    已取消
                                                </label>
                                                <label v-if="order.orderStatus == 1">
                                                    借阅中
                                                </label>
                                                <label v-if="order.orderStatus == 2">
                                                    已归还
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-2 control-label">下单时间</div>
                                        <div class="col-sm-7">
                                            <div class="checkbox">
                                                <label>
                                                    {{order.createTime}}
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">借阅图书</h3>
                    </div><!-- /.box-header -->
                    <div class="box-body">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>图书图片</th>
                                <th>图书名称</th>
                                <th>数量</th>
                                <th>作者</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr v-for="orderBook in order.orderBookList">
                                <td>
                                    <img alt="" :src="orderBook.picUrl" width="64px" height="80px">
                                </td>
                                <td>{{orderBook.bookName}}</td>
                                <td>{{orderBook.num}}</td>
                                <td>{{orderBook.author}}</td>
                            </tr>
                            </tbody>
                        </table>

                        <br>
                        <a class="btn btn-primary" @click="returnBook" v-if="order.orderStatus == 1">归还</a>
                        <input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                    </div>
                </div>
            </div>
        </section>
    </div>
</div>
<script src="/css/jquery.min.js"></script>
<script src="/css/vue.min.js"></script>
<script src="/css/bootstrap.min.js"></script>
<script src="/css/bootstrap-table.min.js"></script>
<script src="/css/app.js"></script>
<script src="/js/admin/components.js"></script>
<script src="/js/admin/common.js"></script>
<script src="/js/admin/order/order.js"></script>
</body>
</html>